package cn.com.colasoft;

import java.text.MessageFormat;
import java.util.ServiceLoader;

/**
 * @author lizhitao
 * @date 2021/4/19
 */
public class PluginManager {

    public static void main(String[] args) {
        ServiceLoader<ConnectorPlugin> plugins = ServiceLoader.load(ConnectorPlugin.class);
        for (ConnectorPlugin plugin : plugins) {
            System.out.println(MessageFormat.format("-- 加载 {0} plugin --", plugin.getName()));
        }
        System.out.println("-- Finish --");
    }
}
